package cn.zwx.common.elastic.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author zhangwenxue
 */
@ConfigurationProperties(prefix = "cn.zwx.elasticsearch")
public class ElasticProperty {


    /**
     * url
     */
    private final List<String> uris = new ArrayList<>(Collections.singletonList("http://localhost:9200"));

    /**
     *  连接超时时间
     */
    private int connectTimeOut ;

    /**
     * 连接超时时间
     */
    private int socketTimeOut ;

    /**
     * 获取连接的超时时间
     */
    private int connectionRequestTimeOut ;

    /**
     * 最大连接数
     */
    private int maxConnectNum ;

    /**
     * 最大路由连接数
     */
    private int maxConnectPerRoute ;

    /**
     * 密码
     */
    private String password ;

    /**
     * 用户
     */
    private String username ;

    public List<String> getUris() {
        return uris;
    }

    public int getConnectTimeOut() {
        return connectTimeOut;
    }

    public void setConnectTimeOut(int connectTimeOut) {
        this.connectTimeOut = connectTimeOut;
    }

    public int getSocketTimeOut() {
        return socketTimeOut;
    }

    public void setSocketTimeOut(int socketTimeOut) {
        this.socketTimeOut = socketTimeOut;
    }

    public int getConnectionRequestTimeOut() {
        return connectionRequestTimeOut;
    }

    public void setConnectionRequestTimeOut(int connectionRequestTimeOut) {
        this.connectionRequestTimeOut = connectionRequestTimeOut;
    }

    public int getMaxConnectNum() {
        return maxConnectNum;
    }

    public void setMaxConnectNum(int maxConnectNum) {
        this.maxConnectNum = maxConnectNum;
    }

    public int getMaxConnectPerRoute() {
        return maxConnectPerRoute;
    }

    public void setMaxConnectPerRoute(int maxConnectPerRoute) {
        this.maxConnectPerRoute = maxConnectPerRoute;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}
